#include <stdio.h>
#include <stdlib.h>

int flip()
{
    return rand() % 2;
}

int main()
{
    int i, front = 0, back = 0, r;
    //srand(123);
    for (i = 0; i < 100; i++)
    {
        r = flip();
        if (r == 1)
            front++;
        else
            back++;
        printf("%d ", r);
    }
    printf("\n%d %d\n", front, back);
    return 0;
}
